-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add comments to events based cache code #5327
Conversation
Signed-off-by: Faisal Memon <fymemon@yahoo.com>
// the longer running transaction will be skipped over | ||
if !a.firstEventTime.IsZero() && event.EventID != a.lastEventID+1 { | ||
// the longer running transaction will be skipped over. | ||
if !a.firstEventTime.IsZero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following same style suggested by this code review comment.
// the longer running transaction will be skipped over | ||
if !a.firstEventTime.IsZero() && event.EventID != a.lastEventID+1 { | ||
// the longer running transaction will be skipped over. | ||
if !a.firstEventTime.IsZero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following same style suggested by this code review comment.
Signed-off-by: Faisal Memon <fymemon@yahoo.com>
@@ -188,7 +188,6 @@ func (a *attestedNodes) replayMissedEvents(ctx context.Context) { | |||
switch status.Code(err) { | |||
case codes.OK: | |||
case codes.NotFound: | |||
log.Debug("Event not yet populated in database") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do two things here:
- Leave a comment as to why we don't log anything (noise that was brought up)
- Make this a metric? That way at least we're not blind to the situation but it won't muddy our logs.
Side quesiton: Where did we land on this being downgraded to a Trace log to reduce the noise instead of getting rid of it altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stevend-uber for the feedback. Ill work on making the metrics changes. I didnt understand the side question though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For #1: Mostly why we don't do anything for case codes.NotFound:
.
Upon initial reading of the code without your or my context, another contributor is likely to add a log here and we're back where we started :)
It's not blocking so I'm cool just adding it later :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging for not found is likely to be better handled in #5341 as part of the backoff algorithm, and we intend to add a guage to track the entries in #4720. With these items, which are more specific, I'll ask that we not attempt non-comment changes in this PR, as it makes the PR lose focus and then velocity reduces.
If the two PRs mentioned above don't handle the issue, please search #5327, #5342, #4720, or #5349 to see if it is covered there, and if not, open a new PR.
@azdagron Please see if you can provide a second review on this item, I would review it, but I want eyes further from the solution to see if the comments read better to a wider audience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few nits here and there.
pkg/server/endpoints/authorized_entryfetcher_registration_entries.go
Outdated
Show resolved
Hide resolved
pkg/server/endpoints/authorized_entryfetcher_registration_entries.go
Outdated
Show resolved
Hide resolved
pkg/server/endpoints/authorized_entryfetcher_registration_entries.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrew Harding <azdagron@gmail.com> Signed-off-by: Faisal Memon <fymemon@yahoo.com>
Co-authored-by: Andrew Harding <azdagron@gmail.com> Signed-off-by: Faisal Memon <fymemon@yahoo.com>
Pull Request check list
Affected functionality
Events based cache
Description of change